package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PeriodInventoryMapper;
import com.ruoyi.system.domain.PeriodInventory;
import com.ruoyi.system.service.IPeriodInventoryService;

/**
 * 期初期末Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-20
 */
@Service
public class PeriodInventoryServiceImpl implements IPeriodInventoryService 
{
    @Autowired
    private PeriodInventoryMapper periodInventoryMapper;

    /**
     * 查询期初期末
     * 
     * @param id 期初期末主键
     * @return 期初期末
     */
    @Override
    public PeriodInventory selectPeriodInventoryById(Long id)
    {
        return periodInventoryMapper.selectPeriodInventoryById(id);
    }

    /**
     * 查询期初期末列表
     * 
     * @param periodInventory 期初期末
     * @return 期初期末
     */
    @Override
    public List<PeriodInventory> selectPeriodInventoryList(PeriodInventory periodInventory)
    {
        return periodInventoryMapper.selectPeriodInventoryList(periodInventory);
    }

    /**
     * 新增期初期末
     * 
     * @param periodInventory 期初期末
     * @return 结果
     */
    @Override
    public int insertPeriodInventory(PeriodInventory periodInventory)
    {
        periodInventory.setCreateTime(DateUtils.getNowDate());
        return periodInventoryMapper.insertPeriodInventory(periodInventory);
    }

    /**
     * 修改期初期末
     * 
     * @param periodInventory 期初期末
     * @return 结果
     */
    @Override
    public int updatePeriodInventory(PeriodInventory periodInventory)
    {
        return periodInventoryMapper.updatePeriodInventory(periodInventory);
    }

    /**
     * 批量删除期初期末
     * 
     * @param ids 需要删除的期初期末主键
     * @return 结果
     */
    @Override
    public int deletePeriodInventoryByIds(Long[] ids)
    {
        return periodInventoryMapper.deletePeriodInventoryByIds(ids);
    }

    /**
     * 删除期初期末信息
     * 
     * @param id 期初期末主键
     * @return 结果
     */
    @Override
    public int deletePeriodInventoryById(Long id)
    {
        return periodInventoryMapper.deletePeriodInventoryById(id);
    }
}
